<?php

namespace app\controller\mobile;

use app\common\model\Admin;
use app\common\model\Config;
use app\common\model\setting;
use app\common\model\Forum;
use app\common\model\setting\ConfigWeb;
use app\common\model\User;
use app\common\service\IndexService;
use app\common\service\UserService;
use app\common\util\Result;
use think\annotation\route\Get;
use think\annotation\route\Group;
use think\annotation\route\Route;
use think\route\Domain;

#[Group('mobile/index')]
class IndexNoUserController extends MobileBaseController
{

    #[Route("GET", "config")]
    public function config()
    {
//        $config["web"] = Config::getConfigContent("web");
        $versionCode = input("_version", 0);
        if ($versionCode > ConfigWeb::instance()->version_code) {
            //如果客户端版本大于服务端版本，表示在过审
            ConfigWeb::instance()->is_audit = 1;
        }
        return Result::success(["web" => ConfigWeb::instance()->toArray()]);
    }

    #[Get('test')]
    public function test()
    {

        $configWeb = ConfigWeb::instance();
        ConfigWeb::instance()->toJson();
        ConfigWeb::instance()->toArray();
        ConfigWeb::instance()->getDayByHour(3);

        print_r($configWeb->toArray());
    }


}
